home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Franz PD / Franz PD Disk #324 (1994-04)(Rhein-Sieg-Soft).zip / Franz PD Disk #324 (1994-04)(Rhein-Sieg-Soft).adf / VideoText3.5 / source / include / req.lib < prev   
Text File  |  1994-04-01  |  17KB  |  369 lines

  1. { reqlibrary.h © 1988/1989/1990 reserved by Colin Fox and Bruce Dawson }
  2.  
  3. {$if not def REQLIBRARY_LIB}
  4. Const REQLIBRARY_LIB=26731;
  5.  
  6. {$if not def INTUITION_INTUITION_H;incl"intuition/intuition.h";endif}
  7. {$if not def INTUITION_SCREENS_H;  incl"intuition/screens.h";  endif}
  8. {$if not def LIBRARIES_DOS_H;      incl"libraries/dos.h";      endif}
  9. {$if not def EXEC_LIBRARIES_H;     incl"exec/libraries.h";     endif}
  10. {$if not def EXEC_DEVICES_H;       incl"exec/devices.h";       endif}
  11. {$if not def EXEC_IO_H;            incl"exec/io.h";            endif}
  12.  
  13. {
  14. **      $Filename: libraries/reqbase.h $
  15. **      $Release: 2.0 release 1 $
  16. **      $Revision: 2.5 $
  17. **      $Date: 90/11/23 $
  18. **
  19. **      req.library definitions
  20. **
  21. }
  22.  
  23. Const
  24.   REQVERSION = 2;
  25.   NUMPAIRS = 10;
  26.  
  27. Type
  28. p_GadgetBlock = ^GadgetBlock;
  29. p_StringBlock = ^StringBlock;
  30. p_PropBlock = ^PropBlock;
  31. p_ScrollBlock = ^ScrollBlock;
  32. p_TwoImageGadget = ^TwoImageGadget;
  33. p_TRStructure = ^TRStructure;
  34. p_ExtendedColorRequester = ^_ExtendedColorRequester;
  35. p_GetLongStruct = ^GetLongStruct;
  36. p_GetStringStruct = ^GetStringStruct;
  37. p_ESStructure = ^ESStructure;
  38. p_ReqFileRequester = ^ReqFileRequester;
  39. p_ReqScrollStruct = ^ReqScrollStruct;
  40. p_chipstuff = ^chipstuff;
  41. p_ReqLib = ^ReqLib;
  42. GadgetBlock = Record
  43.   Gadget: Gadget;
  44.   Border: Border;
  45.   Pairs: Array[1..NUMPAIRS] of Integer;
  46.   Text: IntuiText;
  47. end;
  48. StringBlock = Record
  49.   Gadget: Gadget;
  50.   Info: StringInfo;
  51.   Border: Border;
  52.   Pairs: Array[1..NUMPAIRS] of Integer;
  53. end;
  54. PropBlock = Record
  55.   Gadget: Gadget;
  56.   Info: PropInfo;
  57.   Image: Image;
  58. end;
  59. ScrollBlock = Record
  60.   ArrowUpLt: Gadget;
  61.   ImageUpLt: Image;
  62.   ArrowDnRt: Gadget;
  63.   ImageDnRt: Image;
  64.   Prop: PropBlock;
  65. end;
  66. TwoImageGadget = Record
  67.   Gadget: Gadget;
  68.   Image1: Image;
  69.   Image2: Image;
  70. end;
  71.  
  72. Const
  73.   HORIZSLIDER = $0;       {which way the slider stands}
  74.   VERTSLIDER = $10000;    {This is so that it bypasses all gadget flags.}
  75.  
  76. { This structure is use with the TextRequester function.}
  77.  
  78. Type
  79. TRStructure = Record
  80.   Text,               { This is the message text, including printf() style formatting if desired.}
  81.   Controls: Str;      { This is the address of the parameter list, if printf() style formatting is used.}
  82.   Window: p_Window;   { This is an optional (zero if not used) pointer to a window on the screen you}
  83.                       { would like the requester to show up on.}
  84.   MiddleText,         { If non-zero, this is the text for the gadget in the lower middle (returns 2).}
  85.   PositiveText,       { If non-zero, this is the text for the gadget in the lower left hand corner (returns 1).}
  86.   NegativeText,       { If non-zero, this is the text for the gadget in the lower right (returns 0).}
  87.   Title: Str;         { This is the title for the window.}
  88.   KeyMask: Integer;   { This is the qualifier mask for the keyboard shortcuts.}
  89.                       { Use $FFFF to allow any qualifiers (or none).}
  90.                       { Zero means that no keyboard shortcuts are allowed.}
  91.   textcolor,          { Color of the text.  Uses color 1 if no color specified. }
  92.   detailcolor,        { Detail and block color, as in a NewWindow structure.  If }
  93.   blockcolor,         { both are left zero, block pen will be set to 1. }
  94.   versionnumber: Integer;  { Make SURE this is set to REQVERSION. }
  95.   Timeout: Word;      { the timeout value in seconds }
  96.   AbortMask: Long;    { If the requester gets a Signal() with this bit, it will abort }
  97.                       { this is useful for remote-control applications. }
  98.   rfu1: Word;
  99. end;
  100.  
  101. { NOTE:
  102.  
  103.     The  control  values  mentioned above are used if you choose to insert
  104. printf  style directives in your strings and should contain the address of
  105. a list of control parameters, usually on the stack.
  106.     }
  107.  
  108.  
  109. {         Remember,   if  you  don't  want  to  go  through  the  hassle  of }
  110. { initializing a ExtendedColorRequester structure, you can always just call }
  111. { ColorRequester  (as opposed to ExtendedColorRequester).  ColorRequester }
  112. { just  takes  a  single  parameter, in D0, the color that should start out }
  113. { being highlit.  It returns a single value, the color that was selected at }
  114. { the end. }
  115.  
  116. {         This structure is for use with the ExtendedColorRequester (_not_, }
  117. { the ColorRequester) function. }
  118.  
  119. _ExtendedColorRequester = Record
  120.   defcolor: Long;    {The color that is initially highlit. }
  121.   window: p_Window   {The window the 'requester' opens up in. }
  122.   rfu1,              {Who knows what these will be used for, }
  123.   rfu2,              {but I'm sure we'll think of something. }
  124.   rfu3,              {Until then, just keep these zeroed. }
  125.   rfu4,              {Okay? }
  126.   rfu5: Long;
  127. end;
  128.  
  129.  
  130. {         This structure is for use with the GetLong function.}
  131.  
  132. Const
  133.   GLNODEFAULTM = 1       {Set this bit in the flags if you don't want a default}
  134.                          {value to show up in the get long string gadget.  For}
  135.                          {some things this is much better than having a zero}
  136.                          {show up.}
  137.  
  138. Type
  139. GetLongStruct = Record;
  140.   titlebar: Str;
  141.   defaultval,
  142.   minlimit,
  143.   maxlimit,
  144.   result: Long;
  145.   window: p_Window;
  146.   versionnumber: Integer;  { Make SURE this is set to REQVERSION. }
  147.   flags,                   { Some, uh flags.  See above for bit definitions. }
  148.   rfu2: Long;              { Make SURE you leave these two zeroed also. }
  149. end;
  150. GetStringStruct = Record
  151.   titlebar: Str;
  152.   stringbuffer: Str;
  153.   window: p_Window;
  154.   stringsize,              { how many characters in the buffer }
  155.   visiblesize,             { how many characters show on screen }
  156.   versionnumber: Integer;  { make sure this is REQVERSION }
  157.   flags,
  158.   rfu1,
  159.   rfu2,
  160.   rfu3: Long;
  161. end;
  162.  
  163.  
  164. {$ if not def DSIZE}
  165. Const
  166.   DSIZE = 130;
  167.   FCHARS = 30;
  168. {$ endif }
  169.  
  170. Const
  171.   WILDLENGTH = 30;
  172.  
  173. {        These  are  the  bit  numbers  of various bits that you can set in the
  174. Flags  field of the file requester structure. }
  175.  
  176. Const
  177.   FRQSHOWINFOM =      $1;  {Set this in Flags if you want .info files to show.  They default to hidden.}
  178.   FRQEXTSELECTM =     $2;  {Set this in Flags if you want extended select.  Default is not.}
  179.   FRQCACHINGM =       $4;  {Set this in Flags if you want directory caching.  Default is not.}
  180.   FRQGETFONTSM =      $8;  {Set this in Flags if you want a font requester rather than a file requester.}
  181.   FRQINFOGADGETM =   $10;  {Set this in Flags if you want a hide-info files gadget.}
  182.   FRQHIDEWILDSM =    $20;  {Set this in Flags if you DON'T want 'show' and 'hide' string gadgets.}
  183.   FRQABSOLUTEXYM =   $40;  {Use absolute x,y positions rather than centering on mouse.}
  184.   FRQCACHEPURGEM =   $80;  {Purge the cache whenever the directory date stamp changes if this is set.}
  185.   FRQNOHALFCACHEM = $100;  {Don't cache a directory unless it is completely read in when this is set.}
  186.   FRQNOSORTM =      $200;  {Set this in Flags if you DON'T want sorted directories.}
  187.   FRQNODRAGM =      $400;  {Set this in Flags if you DON'T want a drag bar and depth gadgets.}
  188.   FRQSAVINGM =      $800;  {Set this bit if you are selecting a file to save to.}
  189.   FRQLOADINGM =    $1000;  {Set this bit if you are selecting a file(s) to load from.}
  190.                            {These two bits (save and load) aren't currently used for}
  191.                            {anything, but they may be in the future, so you should}
  192.                            {remember to set them.  Also, these bits make it easier if}
  193.                            {somebody wants to customize the file requester for their}
  194.                            {machine.  They can make it behave differently for loading}
  195.                            {vs saving.}
  196.   FRQDIRONLYM =    $2000;  {Allow the user to select a directory, rather than a file.}
  197.  
  198. Type
  199. ESStructure = Record
  200.   NextFile: p_ESStructure;
  201.   NameLength,              { Length of thefilename field, not including the terminating zero. }
  202.   Pad: Integer;
  203.   Node: Ptr;               { For internal use only. }
  204.   thefilename: Char;   { This is a variable size field. }
  205. end;
  206. ReqFileRequester = Record
  207.   VersionNumber: Word;     { Make sure this is set to REQVERSION. }
  208.   Title,                   { Hailing text }
  209.   Dir,                     { Directory array (DSIZE+1) }
  210.   _File,                    { Filename array (FCHARS+1) }
  211.   PathName: Str;           { Complete path name array (DSIZE+FCHARS+2) }
  212.   Window: p_Window;        { Window requesting or NULL }
  213.   MaxExtendedSelect,       { Zero implies a maximum of 65535, as long as FRQEXTSELECT is set.}
  214.   numlines,                { Number of lines in file window. }
  215.   numcolumns,              { Number of columns in file window. }
  216.   devcolumns: Word;
  217.   Flags: Long;             { Various - umm - flags.  See above for more info. }
  218.   dirnamescolor,           { These five colors will all default }
  219.   filenamescolor,          { to color one if you don't specify }
  220.   devicenamescolor,        { a color (ie; if you specify color zero). }
  221.   fontnamescolor,          { If you want color zero to be used, specify }
  222.   fontsizescolor: Word;    { color 32, or some other too large number }
  223.                            { which mods down to zero. }
  224.   detailcolor,             { If both of these colors are specified as }
  225.   blockcolor: Word;        { zero then the block pen will be set to one. }
  226.   gadgettextcolor,         { The color for the text of the five boolean gadgets.  Defaults to 1. }
  227.   textmessagecolor,        { The color for the message at the screen top.  Defaults to 1. }
  228.   stringnamecolor,         { The color for the words Drawer, File, Hide and Show.  Defaults to 3. }
  229.   stringgadgetcolor,       { The color for the borders of the string gadgets.  Defaults to 3. }
  230.                            { Unfortunately it is not possible to specify }
  231.                            { the color of the actual text in an Intuition }
  232.                            { string gadget. }
  233.   boxbordercolor,          { The color for the boxes around the file and directory areas.  Defaults to 3. }
  234.   gadgetboxcolor: Word;    { The color for the boxes around the five boolean gadgets.  Defaults to 3. }
  235.   FRU_Stuff: Array[1..18] of Word;    { This area, which is reserved for }
  236.                                       { future use, should all be zero. }
  237.   DirDateStamp: DateStamp; { A copy of the cached directories date stamp. }
  238.                            { There should never be any need to change this. }
  239.   WindowLeftEdge,          { These two fields are used for the Center }
  240.   WindowTopEdge: Word;     { function. See the Center() function docs }
  241.                            { for their explanation.}
  242.   FontYSize,               { These fields are used to return the selected }
  243.   FontStyle: Word;         { font size and style, only applicable when the }
  244.                            { font bit is set. }
  245.   {If you set the extended select bit and the user extended selects, the list of filenames will start from here.}
  246.   ExtendedSelect: p_ESStructure;
  247.   Hide: Array[-1..WILDLENGTH] of Char;   { The wildcards text. }
  248.   Show: Array[-1..WILDLENGTH] of Char;   { More wildcards text. }
  249.   FileBufferPos,           { Various fields taken from the various }
  250.   FileDispPos,             { string gadgets so that the cursor }
  251.   DirBufferPos,            { can be returned to the same position }
  252.   DirDispPos,              { on subsequent calls. }
  253.   HideBufferPos,
  254.   HideDispPos,
  255.   ShowBufferPos,
  256.   ShowDispPos: Integer;
  257.   {      The  following  fields are PRIVATE!  Don't go messing with them or
  258.   weird  things may/will happen.  If this isn't enough of a warning, go read
  259.   the one in intuition.h, that should scare you off. }
  260.   Memory,                  { Memory allocate for dir entries. }
  261.   Memory2,                 { More memory, used for hidden files. }
  262.   Lock: Ptr;
  263.   PrivateDirBuffer: Array[-1..DSIZE] of Char;  { Used for keeping a record }
  264.                            { of which directory we have file names for. }
  265.   FileInfoBlock: p_FileInfoBlock;
  266.   NumEntries,
  267.   NumHiddenEntries: Integer;
  268.   filestartnumber,
  269.   devicestartnumber: Integer;
  270. end;
  271.  
  272. {        This is used with the RealTimeScroll function. }
  273.  
  274. ReqScrollStruct = Record
  275.   TopEntryNumber: Long;     {This is the ordinal number of the first}
  276.                             {displayed entry.}
  277.   NumEntries: Long;         {This is the total number of entries in}
  278.                             {the list.}
  279.   LineSpacing: Word;        {This is how many pixels high each entry is.}
  280.   NumLines: Long;           {This is how many entries can be displayed simultaneously.}
  281.   PropGadget: p_Gadget;     {This is a pointer to the prop gadget being monitored.}
  282.   RedrawAll: Ptr;           {This routine is used to redraw all of the}
  283.                             {entries when the user moves far enough}
  284.                             {that scrolling will take too long.}
  285.                             { The ScrollStruct is passed on the stack }
  286.                             { and in A0 }
  287.   ReadMore: Ptr;            {An optional routine that is called when}
  288.                             {the scroll routine is waiting for movement.}
  289.                             {This allows reading of new data while real}
  290.                             {time scrolling.}
  291.                             { The ScrollStruct is passed on the stack }
  292.                             { and in A0 }
  293.   ScrollAndDraw: Ptr;       {This routine is called when the data needs}
  294.                             {to be scrolled and updated.  This routine is}
  295.                             {passed five long parameters (on the stack and}
  296.                             {in D0-D3/A0) which are, respectively:}
  297.                             {D0 - entry number of first line to be drawn.}
  298.                             {D1 - pixel offset to draw first line at.}
  299.                             {D2 - amount to scroll before doing any drawing.}
  300.                             {D3 - number of lines of data to draw.}
  301.                             {A0 - the Scroll structure itself. }
  302.   versionnumber: Integer;   {REQVERSION should be put here}
  303.   rfu1,                     {Make SURE you leave these two zeroed also. }
  304.   rfu2: Integer;
  305. end;
  306. chipstuff = Record
  307.   ArrowUp: String[20];            { 16 pixels wide, 10 pixels high. }
  308.   ArrowDown: String[20];          { 16 pixels wide, 10 pixels high. }
  309.   ArrowLeft: String[18];          { 16 pixels wide, 9 pixels high. }
  310.   ArrowRight: String[18];         { 16 pixels wide, 9 pixels high. }
  311.   Letter_R: String[20];           { 16 pixels wide, 10 pixels high. }
  312.   Letter_G: String[20];           { 16 pixels wide, 10 pixels high. }
  313.   Letter_B: String[20];           { 16 pixels wide, 10 pixels high. }
  314.   Letter_H: String[20];           { 16 pixels wide, 10 pixels high. }
  315.   Letter_S: String[20];           { 16 pixels wide, 10 pixels high. }
  316.   Letter_V: String[20];           { 16 pixels wide, 10 pixels high. }
  317. end;
  318. ReqLib = Record
  319.   RLib: _Library;
  320.   SysLib,
  321.   DosLib,
  322.   IntuiLib,
  323.   GfxLib: p_Library;
  324.   SegList: Ptr;
  325.   Images: p_chipstuff;
  326.   Flags,
  327.   Pad: Byte;
  328.   ConsoleDev: p_Device;
  329.   ConsoleHandle: p_IOStdReq;
  330.   RexxSysBase: p_Library;
  331. end;
  332.  
  333. Var ReqBase:ptr;
  334.  
  335. Library ReqBase:
  336. -42: Procedure _AddGadget(a0:p_Window; a1:p_Gadget; d0:ptr);
  337. -30: Procedure Center(a0:p_NewWindow; d0, d1: Word);
  338. -36: Function SetSize(d0, d1: Long): Integer;
  339. -42: Function SetLocation(d0, d1, d2: Long): Integer;
  340. -48: Function ReadLocation(d0, d1: Long; d2: Integer): Long;
  341. -54: Function ReqFormat(a2, a1: Str; a0: Ptr): Long;  { a0 ist ^Str }
  342. {-60: Dispatch}
  343. {-66: Fake1}
  344. {-72: Fake2}
  345. {-78: Fake3}
  346. -84: Function FileRequester(a0: p_ReqFileRequester): Boolean;
  347. -90: Function ColorRequester(a0: Long): Long;
  348. -96: Procedure DrawBox(a1: p_RastPort; d0, d1, d2, d3: Long);
  349. -102: Procedure MakeButton(a0: p_TwoImageGadget; a1, a2: Ptr; d0, d1, d2: Long);
  350. { a1, a2 sind eigentlich Str, allerdings zeigen sie auf Bilddaten }
  351. -108: Procedure MakeScrollBar(a0: p_ScrollBlock, d0, d1, d2, d3: Long);
  352. -114: Procedure PurgeFiles(a0: p_ReqFileRequester);
  353. {-120: GetFontHeightAndWidth}
  354. -126: Procedure MakeGadget(a0: p_GadgetBlock; a1: Str; d0, d1: Long);
  355. -132: Procedure MakeString(a0: p_StringBlock; a1, a2: Str; d0, d1, d2, d3: Long);
  356. -138: Procedure MakeProp(a0: p_PropBlock; d0, d1, d2: Long);
  357. -144: Procedure LinkGadget(a0: p_GadgetBlock; a1: Str; a3: p_NewWindow; d0, d1: Long );
  358. -150: Procedure LinkStringGadget(a0: p_StringBlock; a1, a2: Str; a3: p_NewWindow; d0, d1, d2, d3: Long);
  359. -156: Procedure LinkPropGadget(a0: p_PropBlock; a3: p_NewWindow; d0, d1, d2, d3, d4: Long);
  360. -162: Function GetString(a0, a1: Str; a2: p_Window; d0, d1: Integer): Boolean;
  361. -168: Procedure RealTimeScroll(a0: p_ReqScrollStruct);
  362. -174: Function TextRequest(a0: p_TRStructure): Integer;
  363. -180: Function GetLong(a0: p_GetLongStruct): Boolean;
  364. -186: Function RawKeyToAscii(d0, d1: Word; a0: Ptr): Char;
  365. -192: Function ExtendedColorRequester(a0: p_ExtendedColorRequester): Long;
  366. -198: Function NewGetString(a0: p_GetStringStruct): Boolean;
  367. End;
  368. {$endif}
  369.